function createUserList() {
  return [
    {
      id: '1',
      username: '张三',
      password: '123'
    },
    {
      id: '2',
      username: '里斯',
      password: '123'
    }
  ]
}

export default [
  {
    url: '/api/user/login',
    method: 'post',
    response: ({ body }) => {
      const { username, password } = body
      const checkUser = createUserList().find((item) => {
        return item.username === username && item.password === password
      })
      if (checkUser) {
        return {
          code: 200,
          data: {
            message: '登录成功',
            token: 12344
          }
        }
      } else {
        return {
          code: 201,
          data: {
            message: '账号或密码不正确'
          }
        }
      }
    }
  },
  {
    url: '/api/user/info',
    method: 'post',
    response: ({ body }) => {
      return {
        code: 200,
        data: {
          list: []
        }
      }
    }
  }
]
